#pragma once

#ifndef _CWEAPONITEM_H_
#define _CWEAPONITEM_H_

// Item types for m_type
#define WEAPON_NORMAL		0x50
#define WEAPON_ENCHANTED	0x51
#define WEAPON_AUGMENTED	0x52

// WEAPON types for m_skillType
#define WEAPON_NONE		0x00
#define WEAPON_H2H		0x01
#define WEAPON_DAG		0x02
#define WEAPON_SWD		0x03
#define WEAPON_GSD		0x04
#define WEAPON_AXE		0x05
#define WEAPON_GAX		0x06
#define WEAPON_SYH		0x07
#define WEAPON_POL		0x08
#define WEAPON_KAT		0x09
#define WEAPON_GKT		0x0a
#define WEAPON_CLB		0x0b
#define WEAPON_STF		0x0c

// Item types from database
#define DB_SLOTAMMO		3
#define DB_SLOTMAIN		6
#define DB_SLOTOFFHAND	7  //Grips
#define DB_SLOTRANGED	8

#include <vector>

class CSemaphore;
class CModifier;

#include "CItem.h"

class CWeaponItem : public CItem
{
public:
		
	CWeaponItem(unsigned short itemID);
	~CWeaponItem(void);

	void loadStats();
	void loadModifiers();
	void loadAdditionalModifiers();

	void setModelId(unsigned short modelID);
	unsigned short getModelId();
	void setSubModelId(unsigned short subModelID);
	unsigned short getSubModelId();

	void setReqLvl(unsigned char type);
	unsigned char getReqLvl();

	void setEquipSlotId(unsigned char equipSlotID);
	unsigned char getEquipSlotId();

	void addMod(unsigned char modifier, char amount);
	char getModAmount(unsigned char modifier);

	void setSkillType(unsigned char skillType);
	unsigned char getSkillType();

	void setDelay(unsigned short delay);
	unsigned short getDelay();

	void setDamage(unsigned short damage);
	unsigned short getDamage();

	void setDmgType(unsigned short dmgType);
	unsigned short getDmgType();

private:

	unsigned char m_reqLvl;
	unsigned short m_modelID;
	unsigned short m_subModelID;

	unsigned char m_skillType;
	unsigned char m_equipSlotID;

	unsigned short m_damage;
	unsigned short m_delay;

	unsigned short m_dmgType;

	//MODIFIERS
	std::vector<CModifier *> modList;
	//modifier list semaphore
	CSemaphore * modListSemaphore;
	//locks modifier list
	void lockModifierList(void);
	//Unlocks modifier list
	void unlockModifierList(void);
};

#endif